package com.android.tianyuanyouxuan.ui.adapter;

import androidx.annotation.NonNull;

import com.android.tianyuanyouxuan.R;
import com.android.tianyuanyouxuan.bean.Message;
import com.blankj.utilcode.constant.TimeConstants;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

public class MessageActivityAdapter extends BaseQuickAdapter<Message, BaseViewHolder> {
    public MessageActivityAdapter() {
        super(R.layout.item_message_details);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, Message item) {
        baseViewHolder.setText(R.id.tv_user, item.getUser());
        baseViewHolder.setText(R.id.tv_message, item.getText());
        baseViewHolder.setText(R.id.tv_time, TimeUtils.getString(item.getDate(), 0, TimeConstants.MSEC));
    }
}
